<%= form_for [kuztuscms, @page], :html => { :class => 'form-horizontal' } do |f| %>
  <% if @page.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@page.errors.count, "error") %> prohibited this page from being saved:</h2>

      <ul>
      <% @page.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
  <fieldset>
    <legend><%= controller.action_name.capitalize %> Page</legend>

    <div class="control-group">
      <%= f.label :name, :class => 'control-label' %>
      <div class="controls">
        <%= f.text_field :name, :class => 'text_field' %>
      </div>
    </div>

    <div class="control-group">
      <%= f.label :article_id, :class => 'control-label' %>
      <div class="controls">
        <%= f.select :article_id,
          options_from_collection_for_select(@articles, :id, :name, @page.article_id), :class => 'select' %>
      </div>
    </div>

    <div class="control-group">
      <%= f.label :layout_id, :class => 'control-label' %>
      <div class="controls">
        <%= f.select :layout_id, 
          options_from_collection_for_select(@layouts, :id, :path, @page.layout_id), :class => 'select' %>
      </div>
    </div>

    <div class="control-group">
      <%= f.label :title, :class => 'control-label' %>
      <div class="controls">
        <%= f.text_field :title, :class => 'text_field' %>
      </div>
    </div>

   <div class="control-group">
      <%= f.label :path, :class => 'control-label' %>
      <div class="controls">
        <%= f.text_field :path, :class => 'text_field' %>
      </div>
    </div>

   <div class="control-group">
      <%= f.label :description, :class => 'control-label' %>
      <div class="controls">
        <%= f.text_area :description, :class => 'span8 text_area' %>
      </div>
    </div>

   <div class="control-group">
      <%= f.label :keywords, :class => 'control-label' %>
      <div class="controls">
        <%= f.text_area :keywords, :class => 'span8 text_area' %>
      </div>
    </div>

    <div class="control-group">
      <div class="controls">
        <label class="checkbox">
          <%= f.check_box :default %> <%= f.label :default %>
        </label>
      </div>
    </div>
 
    <div class="form-actions">
      <%= f.submit nil, :class => 'btn btn-primary' %>
      <%= link_to 'Cancel', kuztuscms.pages_path, :class => 'btn' %>
    </div>
  </fieldset>
<% end %>
